home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_12_03
/
plauger
/
new1.cpp
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1994-01-12
|
357 b
|
14 lines
Listing 2 -- The function operator new(size_t)
// operator new(size_t) REPLACEABLE function
#include <stdlib.h>
#include <new>
void *operator new(size_t size)
{ // try to allocate size bytes
void *p;
while ((p = malloc(size)) == 0 && _New_hand != 0)
(*_New_hand)();
return (p);
}